server {
    listen 17001;
    server_name 127.0.0.1;
    proxy_buffer_size 4k;
    proxy_buffers 16 32k;
    proxy_busy_buffers_size 64k;
    proxy_temp_file_write_size 64k;
    proxy_read_timeout 180;
    proxy_redirect off;
    proxy_set_header Host $http_host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forward-For $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

    set $prjroot /Users/twisty/workspace/php/pms;
    root  $prjroot/public/index.php;
    gzip on;
    gzip_min_length 4k;
    gzip_comp_level 1;
    gzip_types text/plain application/x-javascript text/css application/xml application/json;
    client_max_body_size 20M;
    location  /version {
        root $prjroot/index.php;
        add_header Content-Type text/plain;
    }
    index localindex.php index.php index.html;
    location / {
        root    $prjroot/public/index.php;
        index   index.html index.php;
        try_files $uri $uri/ /index.php?$args;
    }
    location ~ \.php {
        fastcgi_pass   127.0.0.1:9000;
        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        include        fastcgi_params;
        proxy_ignore_client_abort on;
    }
}
